<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
    }
    :root {
      --wh: 100px;
      --ringW: 20px;
    }
    .circle {
      position: relative;
      width: var(--wh);
      height: var(--wh);
      border-radius: 50%;
      background-color: #eee;
    }
    .left,.right {
      position: absolute;
      width: 50%;
      height: 100%;
      /* background-color: black; */
      opacity: 0.5;
      overflow: hidden; /*必须设置*/
    }
    .left {
      left: 0;
    }
    .right {
      right: 0;
    }
    .left .left-circle, .right .right-circle {
      width: 100%;
      height: 100%;
      background-color: red;
      opacity: 0.5;
      transition: all 0.5s;
    }
    .left .left-circle {
      border-top-left-radius: var(--wh);
      border-bottom-left-radius: var(--wh);
      transform-origin: right center;
      transform: rotate(180deg);/*默认看不到环*/
      background-color: green;
    }
    .right .right-circle {
      border-top-right-radius: var(--wh);
      border-bottom-right-radius: var(--wh);
      transform-origin: left center;
      transform: rotate(-180deg);/*默认看不到环*/
      background-color: blue;
    }

    .inner {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      width: calc(var(--wh) - var(--ringW));
      height: calc(var(--wh) - var(--ringW));
      line-height: calc(var(--wh) - var(--ringW));
      text-align: center;
      font-size: 24px;
      border-radius: 50%;
      color: #999;
      background-color: #fff; 
    }
    .inner i{
      font-size: 14px;
    }


    .left:hover .left-circle {
      transform: rotate(360deg);
    }
    .right:hover .right-circle {
      transform: rotate(0deg);
    }
  </style>
</head>
<body>
  <div class="circle">
    <div class="left">
      <div class="left-circle"></div>
    </div>
    <div class="right">
      <div class="right-circle"></div>
    </div>
    <div class="inner">
      100<i>%</i>
    </div>
  </div>
</body>
</html>